ABC148 D - Brick Break
https://atcoder.jp/contests/abc148/tasks/abc148_d
提出
code: python
n = int(input())
a = list(map(int, input().split()))
next = 1
ans = 0
for i in a:
if (i == next):
next += 1
else:
ans += 1
if (next == 1):
print(-1)
else:
print(ans)